<?php if($this->insert > 0):?>
<tr id="<?php echo $this->data['cid'] . '-' . $this->data['pid'];?>">
	<td class="left">
		<?php 
		$params = array(
					'url' => $this->url(array(
						'action' => 'set-role',
						'controller' => 'commission',
						'format' => 'html',
						'cid' => $this->data['cid'],
						'pid' => $this->data['pid']
						)					
					),
					'update' => '.message',
					'format' => 'html'
				);				
				$professor = new Db_Model_Professor(array('pid' => $this->data['pid']));
				$commission = new Db_Model_Commission(array('cid' => $this->data['cid']));
				
				$professorCommissionMapper = new Db_Mapper_ProfessorCommission();
				$professorCommissionModel = $professorCommissionMapper->fetchRole($professor,$commission);
				
				echo new Form_Commission_SetRole(
					'role' . $commission->getCid() . $professor->getPid(),
					$params,
					$professorCommissionModel->getRole()				
				);
		?>		
	</td>
	<td class="left">
		<?php echo 
			$this->professor['title_before'] . ' ' . 
			$this->professor['firstname'] . ' ' . 
			$this->professor['lastname'] . ' ' .
			$this->professor['title_behind']
		?>
	</td>
	<td class="center">
		<a class="actionIcon deleteAction" href="#" onClick="javascript:$.post(
						'<?= $this->url(array(
							'controller' => 'commission',
							'action' => 'remove-professor',
							'format' => 'html' 
						)
					) ?>',
					{
						pid: <?php echo $professor['pid']; ?>,
						cid: <?php echo $commission['cid'] ?>,						
					},
					function(result){						
						$('.message').html(result);						
						$('#<?php echo  $commission->getCid() . '-' . $professor->getPid(); ?>').remove();
					});">Odstrániť</a>	
	</td>
</tr>
<?php endif;?>